// src/components/Header/index.tsx
import { LeftOutline } from 'antd-mobile-icons';
import './index.css';

function Header({ 
  title = "海泰电子材料有限责任公司", 
  showBack = false,
  onBack
}: { 
  title?: string; 
  showBack?: boolean;
  onBack?: () => void;
}) {
  return (
    <>
      <div className="header">
        {showBack && (
          <div 
            className="back-button"
            onClick={onBack}
            style={{ 
              padding: '8px', 
              cursor: 'pointer' 
            }}
          >
            <LeftOutline />
          </div>
        )}
        <div>{title}</div>
        <div style={{ width: '32px' }}></div> {/* 用于平衡布局 */}
      </div>
    </>
  );
}

export default Header;